package it.polimi.swKnights.SWIMv2.ejb.entityBeans;

import java.io.Serializable;


public class HelpRequestPk implements Serializable
{
	private long id;
	
	private String askingUserName;
	
	private String answeringUserName;
	
	/*
	 * Serial Version ID
	 */
	
	private static final long serialVersionUID = 2992208896853474823L;

	/*
	 * equals and hashCode
	 */
	
	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((answeringUserName == null) ? 0 : answeringUserName
						.hashCode());
		result = prime * result
				+ ((askingUserName == null) ? 0 : askingUserName.hashCode());
		result = prime * result + (int) (id ^ (id >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HelpRequestPk other = (HelpRequestPk) obj;
		if (answeringUserName == null)
		{
			if (other.answeringUserName != null)
				return false;
		}
		else if (!answeringUserName.equals(other.answeringUserName))
			return false;
		if (askingUserName == null)
		{
			if (other.askingUserName != null)
				return false;
		}
		else if (!askingUserName.equals(other.askingUserName))
			return false;
		if (id != other.id)
			return false;
		return true;
	}
	
	/*
	 * Getters and setters
	 */

	public long getId()
	{
		return id;
	}

	public void setId(long id)
	{
		this.id = id;
	}

	public String getAskingUser()
	{
		return askingUserName;
	}

	public void setAskingUser(String askingUser)
	{
		this.askingUserName = askingUser;
	}

	public String getAnsweringUser()
	{
		return answeringUserName;
	}

	public void setAnsweringUser(String answeringUser)
	{
		this.answeringUserName = answeringUser;
	}
	
}
